package biz.ezcom.spring.aop.service.aop;

import org.aspectj.lang.ProceedingJoinPoint;

public class UserAop {
	/**
	 * advice中：
	 * 		1:@Around(before),@Aefore (annotation与xml方式,执行顺序不同,与注册先后有部分关系) 
	 * 		2:目标方法 
	 * 		3:目标方法有Exception:
	 * 					1)@AfterThrowing
	 * 					2)@After
	 * 		3:目标方法无Exception:
	 * 					1)@AfterRetruning,@Around(after),@After(annotation与xml方式,执行顺序不同,与注册先后有部分关系)
	 * 
	 * advice的执行顺序,annotation与xml方式执行顺序不同(注册的先后有部分关系)
	 * 实际开发中不应考虑同一等级的advice的执行顺序 
	 */

	public void before(){
		System.out.println("UserAop.before()");
	}
	
	public void after(){
		System.out.println("UserAop.after()");
	}

	public void afterThrowing(){
		System.out.println("UserAop.afterThrowing()");
	} 

	public void afterReturning(){
		System.out.println("UserAop.afterReturning()");
	}
	
	public void around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable{
		System.out.println("UserAop.around():before");
		proceedingJoinPoint.proceed();//目标方法 
		System.out.println("UserAop.around():after");
	}
	
	
}
